import request from '@/utils/request'

export function getRoleListAPI(params) {
  return request({
    url: '/park/sys/role',
    method: 'get',
    params
  })
}

export function getTreeListAPI() {
  return request({
    url: '/park/sys/permision/all/tree',
    method: 'GET'
  })
}

export function getRoleDetailAPI(roleId) {
  return request({
    url: `/park/sys/role/${roleId}`,
    method: 'GET'
  })
}

/**
 * 获取角色成员列表
 * @returns
 */
export function getRoleUserAPI(roleId) {
  return request({
    url: `/park/sys/roleUser/${roleId}`
  })
}

export function addRoleAPI(data) {
  return request({
    url: '/park/sys/role',
    method: 'POST',
    data
  })
}
